package com.study.edoc.exception;

/**
 * 自定义系统业务异常类
 */
public class BusinessException extends RuntimeException {

    private int code;
    private String msg;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    public BusinessException(){
        super();
    }


    public BusinessException(BaseErrorInfo baseErrorInfo){
        super(baseErrorInfo.getMsg());
        this.code = baseErrorInfo.getCode();
        this.msg = baseErrorInfo.getMsg();
    }


    public BusinessException(BaseErrorInfo baseErrorInfo,Throwable cause){
        super(baseErrorInfo.getMsg(),cause);
        this.code = baseErrorInfo.getCode();
        this.msg = baseErrorInfo.getMsg();
    }

    public BusinessException(String errMsg){
        super(errMsg);
        this.setMsg(errMsg);
    }


    public BusinessException(String errMsg,Throwable cause){
        super(errMsg,cause);
        this.setMsg(errMsg);
    }


}
